{extend name='main'}

{block name="button"}
<!--{if auth("add")}-->
<button class='layui-btn layui-btn-sm layui-btn-primary' data-open='{:url("add")}'>发布活动</button>
<!--{/if}-->
{/block}

{block name="content"}
<div class="think-box-shadow">
    <div class="layui-tab layui-tab-card think-bg-white">
        <ul class="layui-tab-title">
            {foreach ['index'=>'全部','is_deleted'=>'已结束'] as $k=>$v}
            {if isset($typeOf) and $typeOf eq $k}
            <li class="layui-this" data-open="{:url('index')}?typeOf={$k}">{$v}</li>
            {else}
            <li data-open="{:url('index')}?typeOf={$k}">{$v}</li>
            {/if}{/foreach}
        </ul>
        <div class="layui-tab-content">
            {include file='active/search'}
            <table id="BaseData" data-url="{:sysuri()}" data-target-search="form.form-search"></table>
        </div>
        <table class="layui-table margin-top-10" lay-skin="line">
            {notempty name='list'}
            <thead>
            <tr>
                <th class='list-table-check-td think-checkbox'>
                    <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
                </th>
                <th width="" class='text-center nowrap'>ID</th>
                <th width="" class='text-center nowrap'>标题</th>
                <th width="" class='text-center nowrap'>封面图</th>
                <th width="" class='text-center nowrap'>主办方</th>
                <th width="" class='text-center nowrap'>地址</th>
                <th width="" class='text-center nowrap'>联系方式</th>
                <th width="" class='text-center nowrap'>活动时间</th>
                <th width="" class='text-center nowrap'>费用</th>
                <th width="" class='text-center nowrap'>限制人数</th>
                <th width="" class='text-center nowrap'>报名人数</th>
                <th width="" class='text-center nowrap'>状态</th>
                <th width="" class='text-center nowrap'>发布时间</th>
                <th width="" class='text-center nowrap'>是否热门</th>
                <th width="" class='text-center nowrap'>操作</th>
            </tr>
            </thead>
            {/notempty}
            <tbody>
            {foreach $list as $key=>$vo}
            <tr>
                <td class='list-table-check-td think-checkbox'>
                    <label><input class="list-check-box" type='checkbox' value='{$vo.id}'></label>
                </td>
                <td class="text-center nowrap">{$vo.id|default=""}</td>
                <td class="text-center nowrap">{$vo.title|default=""}</td>
                <td class="text-center nowrap">
                    <img width="120" height="100" src='{$vo.image|default=""}' alt=""/>
                </td>
                <td class="text-center nowrap" style="font-weight: 600; color: #666666">{$vo.sponsor|default=""}</td>
                <td class="text-center nowrap">{$vo.address|default=""}</td>
                <td class="text-center nowrap">{$vo.contact|default=""}</td>
                <td class="text-center nowrap">{$vo.time|timeSub} ~ {$vo.end_time|timeSub}</td>
                <!--{if $vo.type == 0}-->
                <td class="text-center nowrap" style="color: #00B83F;">免费</td>
                <!--{else}-->
                <td class="text-center nowrap" style="color: #880000;">{$vo.price|number_format=2}</td>
                <!--{/if}-->
                <td class="text-center nowrap">{$vo.person|default=""}</td>
                <td class="text-center nowrap">{$vo.join|default=""}</td>

                <td class="text-center nowrap">
                    {eq name='vo.is_deleted' value='0'}<span class="layui-badge layui-bg-green">正常</span>{else}<span
                        class="layui-badge">已下架</span>{/eq}
                </td>
                <td class="text-center nowrap">{$vo.create_time|date="Y-m-d H:i:s"}</td>
                <td class="text-center nowrap">
                    {eq name='vo.is_deleted' value='0'}<span class="layui-badge layui-bg-green">正常</span>{else}<span
                        class="layui-badge">已下架</span>{/eq}
                </td>
                <td class="text-center nowrap">

                    <!--{if auth('pageEdit')}-->
                    <a class="layui-btn layui-btn-sm" data-open="{:url('pageEdit')}?id={$vo.id}" data-title="编辑" data-dbclick data-value="id#{$vo.id}" data-csrf="{:systoken('pageEdit')}">编辑</a>
                    <!--{/if}-->
                    <!--{if $vo.is_deleted eq 1 and auth("state")}-->
                    <a class="layui-btn layui-btn-normal layui-btn-sm" data-confirm="确定要上架吗？"
                       data-action="{:url('state')}" data-value="id#{$vo.id};is_deleted#0"
                       data-csrf="{:systoken('state')}">上 架</a>
                    <!--{/if}-->

                    <!--{if $vo.is_deleted eq 0 and auth("state")}-->
                    <a class="layui-btn layui-btn-warm layui-btn-sm" data-confirm="确定要删除吗？"
                       data-action="{:url('state')}" data-value="id#{$vo.id};is_deleted#1"
                       data-csrf="{:systoken('state')}">删 除</a>
                    <!--{/if}-->
                </td>
            </tr>
            {/foreach}
            </tbody>
        </table>
    </div>
    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
</div>

{/block}